<template>
	<view style="padding: 30rpx;">
		<view style="margin-top: 10rpx;">
			<u-subsection :list="list" :current="current" @change="sectionChange"></u-subsection>
		</view>
		<view style="background-color: #fff;border-radius: 16rpx;margin-top: 20rpx;">
			<u-cell-item v-for="(item,index) in dataList" :key="index" :title="item.title"
				@click="tosmDetail(item.id)"></u-cell-item>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list: [{
						name: '市评审中心',
						id: '1875525163790884866'
					},
					{
						name: '燕郊分中心',
						id: '1875525235886776321'
					}
				],
				current: 0,
				dataList: []
			}
		},
		onLoad() {
			this.getData()
		},
		methods: {
			getData() {
				this.$u.get("/content/list", {
					'govType': this.list[this.current].id
				}).then(res => {
					if (res.success) {
						this.dataList = res.data
					} else {
						this.dataList = []
					}
				})
			},
			sectionChange(index) {
				this.current = index;
				this.getData()
			},
			tosmDetail(id) {
				uni.navigateTo({
					url: "/pages/sm/sm-detail/sm-detail?id=" + id
				})
			}
		}
	}
</script>

<style>

</style>